package leetCode.offer21;

public class Solution1 implements Solution{


    @Override
    public int[] exchange(int[] nums) {
        int[] result = new int[nums.length];
        int start = 0;
        int end = nums.length-1;
        for (int num : nums) {
            if (num % 2 == 0) {
                result[end--] = num;
            } else {
                result[start++] = num;
            }
        }
        return result;
    }

}
